package com.example.cslp.service.Impl;

import com.example.cslp.mapper.CourseMapper;
import com.example.cslp.mapper.CourseMapperByYh;
import com.example.cslp.pojo.entity.Course;
import com.example.cslp.service.CourseServiceByYh;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImplByYh implements CourseServiceByYh {

    @Autowired
    public CourseMapperByYh courseMapper;
    //创建课程
    public Boolean createCourse(Course course){
        return courseMapper.createCourse(course);
    }

    //查询所有课程
    public List<Course> findAllCourse(){
        return courseMapper.findAllCourse();
    }

    //编辑已有课程
    public Boolean editCourse(Course course){
        return courseMapper.editCourse(course);
    }

    //删除课程
    public Boolean deleteCourse(String courseId){
        return courseMapper.delete(courseId);
    }

    //审核用户上传的资料
    public Boolean examMaterial(Course course){
        return courseMapper.examMaterial(course);
    }

    //根据课程id获取课程
    public Course getCourseById(String courseId){
        return courseMapper.getCourseById(courseId);
    }
}
